package com.ruoyi.system.service.yanglao.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.yanglao.YlVideoMapper;
import com.ruoyi.system.domain.yanglao.YlVideo;
import com.ruoyi.system.service.yanglao.IYlVideoService;

/**
 * 视频Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-14
 */
@Service
public class YlVideoServiceImpl implements IYlVideoService 
{
    @Autowired
    private YlVideoMapper ylVideoMapper;

    /**
     * 查询视频
     * 
     * @param id 视频主键
     * @return 视频
     */
    @Override
    public YlVideo selectYlVideoById(Long id)
    {
        return ylVideoMapper.selectYlVideoById(id);
    }

    /**
     * 查询视频列表
     * 
     * @param ylVideo 视频
     * @return 视频
     */
    @Override
    public List<YlVideo> selectYlVideoList(YlVideo ylVideo)
    {
        return ylVideoMapper.selectYlVideoList(ylVideo);
    }

    /**
     * 新增视频
     * 
     * @param ylVideo 视频
     * @return 结果
     */
    @Override
    public int insertYlVideo(YlVideo ylVideo)
    {
        ylVideo.setCreateTime(DateUtils.getNowDate());
        return ylVideoMapper.insertYlVideo(ylVideo);
    }

    /**
     * 修改视频
     * 
     * @param ylVideo 视频
     * @return 结果
     */
    @Override
    public int updateYlVideo(YlVideo ylVideo)
    {
        ylVideo.setUpdateTime(DateUtils.getNowDate());
        return ylVideoMapper.updateYlVideo(ylVideo);
    }

    /**
     * 批量删除视频
     * 
     * @param ids 需要删除的视频主键
     * @return 结果
     */
    @Override
    public int deleteYlVideoByIds(Long[] ids)
    {
        return ylVideoMapper.deleteYlVideoByIds(ids);
    }

    /**
     * 删除视频信息
     * 
     * @param id 视频主键
     * @return 结果
     */
    @Override
    public int deleteYlVideoById(Long id)
    {
        return ylVideoMapper.deleteYlVideoById(id);
    }
}
